package com.xingbg.projectimpl.provider.custom.service;

import com.xingbg.projectimpl.config.BeanOverride;
import com.xingbg.projectimpl.provider.api.custom.dto.CustomItemClass;
import com.xingbg.projectimpl.provider.api.custom.service.CustomService;
import com.xingbg.projectimpl.provider.api.dto.ItemClass;
import com.xingbg.projectimpl.provider.business.service.TestServiceImpl;

import java.util.ArrayList;
import java.util.List;

@BeanOverride
public class CustomTestServiceImpl extends TestServiceImpl implements CustomService{

    @Override
    public String sayHello(String name) {
        return "custom say:"+name;
    }

    @Override
    public List<ItemClass> getList() {
        List<ItemClass> list = new ArrayList<>();

        CustomItemClass itemA = new CustomItemClass();
        itemA.setName("custom:AAA");
        itemA.setDesc("custom:descAAA");
        itemA.setExtendInfo("custom extends AAA");

        CustomItemClass itemb = new CustomItemClass();
        itemb.setName("custom:BBB");
        itemb.setDesc("custom:descBBB");
        itemb.setExtendInfo("custom extends BBB");

        list.add(itemA);
        list.add(itemb);

        return list;
    }


    @Override
    public String customMethod() {
        return "custom method invoked";
    }

//    @Override
//    protected void proctectMethod() {
//        super.proctectMethod();
//    }
}
